package com.wgts.wgts.mvp.presenter.imp;

import com.wgts.wgts.mvp.model.IClassificationActivityModel;
import com.wgts.wgts.mvp.presenter.IClassificationActivityPresenter;
import com.wgts.wgts.mvp.view.IClassificationActivityView;
import com.wgts.wgts.netmodle.HttpResultSubscriber;
import com.wgts.wgts.netmodle.resp.AllClassTypeEntity;

import java.util.List;

public class ClassificationActivityPresenter implements IClassificationActivityPresenter {

    private IClassificationActivityModel model;

    private IClassificationActivityView view;

    public ClassificationActivityPresenter(IClassificationActivityModel model, IClassificationActivityView view) {
        this.model = model;
        this.view = view;
    }


    @Override
    public void initClassType() {
        model.initResult(new HttpResultSubscriber<List<AllClassTypeEntity>>() {
            @Override
            public void onSuccess(List<AllClassTypeEntity> allClassTypeEntities) {
                view.initResult(allClassTypeEntities);
            }

            @Override
            public void _onError(int status, String msg) {
                view.onError(status, msg);
            }
        });
    }
}
